package com.sss.hloster0405;

import java.util.Scanner;

public class Gadener {
	public void creat() {
		Scanner sc = new Scanner(System.in);
		System.out.println("请输入你要创建的类：");
		String attr = sc.next();
		if (attr.equals("苹果")) {
			IFruit fruit = new Apple();
			fruit.apple();
		} else if (attr.equals("香蕉")) {
			IFruit fruit = new Banana();
			fruit.banana();
		} else if (attr.equals("葡萄")) {
			IFruit fruit = new Pear();
			fruit.pear();
		} else {
			System.out.println("输入有误！！");
		}
	}
}
